export 'src/bean/bean.dart' show ColorResult;

import 'package:text_pixel/src/bean/bean.dart';

import 'src/platform_interface/text_pixel_platform_interface.dart';

class TextPixel {
  Future<String?> getPlatformVersion() {
    return TextPixelPlatform.instance.getPlatformVersion();
  }

  /// 获取文字像素化颜色
  /// - [width] 文字区域的宽
  /// - [height] 文字区域的高
  /// - [textList] 文字的键值对列表，如 [{'character': text, 'colorValue': colorValue}]
  /// - [fontSize] 文字大小
  /// - [maxFrames] 最后生成的最大帧数/画面幅数
  /// - [continuousPaint] 连续绘制，当想屏幕上不出现半个字时，设置为[false]，不然设置为[true]
  /// - [horizontalCenter] 是否水平居中，多行时为最后一行
  Future<ColorResult> getTextColors({
    required int width,
    required int height,
    required List<Map<String, dynamic>> textList,
    required int fontSize,
    required int maxFrames,
    required int maxLines,
    required bool continuousPaint,
    required bool horizontalCenter
  }) async{
    return TextPixelPlatform.instance.getTextColors(
        width: width,
        height: height,
        textList: textList,
        fontSize: fontSize,
        maxFrames: maxFrames,
      maxLines: maxLines,
      continuousPaint: continuousPaint,
      horizontalCenter: horizontalCenter
    );
  }
}
